//
//  XWebViewController.swift
//  WeiboForAll
//
//  Created by 放学跟鸽走 on 2017/4/6.
//  Copyright © 2017年 放学跟鸽走. All rights reserved.
//

import UIKit

class XWebViewController: XBaseController {
    fileprivate lazy var webView = UIWebView(frame: UIScreen.main.bounds)
    
    /// 要加载的 URL 字符串
    var urlString: String? {
        didSet {
            
            guard let urlString = urlString,
                let url = URL(string: urlString)
                else {
                    return
            }
            
            webView.loadRequest(URLRequest(url: url))
        }
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        // 设置标题
//        navBarItem.title = "网页"
        
        // 设置 webView
        view.insertSubview(webView, belowSubview: navBar)
//        view = webView
        webView.backgroundColor = UIColor.white
        webView.isOpaque = false
        
        // 设置 contentInset
        webView.scrollView.contentInset.top = navBar.bounds.height
        // Do any additional setup after loading the view.
    }

    

}
extension XWebViewController{
    
}
